<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>京东</title>
    <style>
        *{
            margin-left: 0px;
            margin-top: 0px;
        }
        #zongti{
            background: url("fl.png");
            width: 190px;
            height: 260px;
        }
        #jdms{
            width: 130px;
            height: 120px;
            padding-top: 30px;
            margin:auto;
            color: #fff;
        }
        #sd{
            width: 150px;
            height: 30px;
            margin: 0 auto;
            color: #fff;
        }
        #djs{
            width: 140px;
            margin: 0 auto;
            color: #fff;
            size: 20px;
        }
        .djsxgx{
            width: 40px;
            height: 40px;
            background-color: black;
            color: white;
            font-size: 30px;
        }
        .djsxgf{
            width: 40px;
            height: 40px;
            background-color: black;
            color: white;
            font-size: 30px;
        }
        .djsxgm{
            width: 40px;
            height: 40px;
            background-color: black;
            color: white;
            font-size: 30px;
        }
        .bd{
            font-size: 20px;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div id="zongti">
        <div id="jdms"><h1>京东秒杀</h1></div>
        <div id="sd"><span class="bd">10:00</span>点场 据结束</div>
        <div id="djs" class="bd">
            <span class="djsxgx"><font>00</font></span>:
            <span class="djsxgf"><font>00</font></span>:
            <span class="djsxgm"><font>00</font></span>
        </div>
    </div>
    <script>
        var x=document.querySelector('.djsxgx')
        var f=document.querySelector('.djsxgf')
        var m=document.querySelector('.djsxgm')
        var time =+new Date('2021-6-7 10:00:00')
        countDate()
        setInterval(countDate,1000)
        function countDate(){
            var now=+new Date()
            var ntime=(time-now)/1000
            var h=parseInt(ntime/60/60%24)
            var m=parseInt(ntime/60%60)
            var s=parseInt(ntime%60)
            h=h<10?'0'+h:h;
            m=m<10?'0'+m:m;
            s<10?'0'+s:s;
            x.innerHTML=h
            f.innerHTML=m
            m.innerHTML=s
        }
    </script>
</body>
</html>